package com.gexiaobao.pigeon.ui.dialog

import android.annotation.SuppressLint
import android.content.Context
import android.view.LayoutInflater
import androidx.appcompat.widget.AppCompatTextView
import com.gexiaobao.pigeon.R

/**
 * @author:hxw
 * @date  :2022/12/8
 * @desc  :
 */
class RxDialogMemberInfo(context: Context?) : RxDialog(context!!) {

    private lateinit var tvNameDialog: AppCompatTextView
    private lateinit var tvSendPigeonNumDialog: AppCompatTextView
    private lateinit var tvCloseDialog: AppCompatTextView

    init {
        initView()
    }

    @SuppressLint("MissingInflatedId")
    private fun initView() {
        val dialogView = LayoutInflater.from(context).inflate(R.layout.dialog_member_info_dialog, null)
        tvNameDialog = dialogView.findViewById(R.id.tvNameDialog)
        tvSendPigeonNumDialog = dialogView.findViewById(R.id.tvSendPigeonNumDialog)
        tvCloseDialog = dialogView.findViewById(R.id.tvCloseDialog)

        tvCloseDialog.setOnClickListener {
            dismiss()
        }
        setContentView(dialogView)
    }

    fun setMemberName(name: String) {
        if (name.isEmpty()) {
            return
        }
        tvNameDialog.text = name
    }

    fun setSendPigeonNum(pigeonNum: String) {
        if (pigeonNum.isEmpty()) {
            return
        }
        tvSendPigeonNumDialog.text = pigeonNum
    }

}